<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\GkyWeAccountSearch;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;
use app\common\widgets\MyFileUpload;

/* @var $this yii\web\View */
/* @var $model app\models\GkyGroupMsg */
/* @var $form yii\widgets\ActiveForm */
/* @var $GkyGroupMsg app\models\GkyWeAccountSearch */
?>


<div class="gky-group-msg-form">
    <div class="panel panel-default">
        <!--<div class="panel-heading text-center" style="background: #003eff;color:white">gky-group-msg</div>-->
        <div class="panel-body">
            <?php
            $form = ActiveForm::begin([
                        'options' => ['class' => 'form-horizontal form-group', 'enctype' => 'multipart/form-data'],
                        'fieldConfig' => [
                            'template' => "{label}<div class=\"col-lg-10\">{input}</div>",
                            'labelOptions' => ['class' => 'col-lg-2 control-label'],
                        ]
            ]);
            ?>
            
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?php
                $data = app\models\GkyWeAccount::find()->all();

                $GkyGroupMsg = new GkyWeAccountSearch();
                echo $form->field($model, 'wename')->widget(Select2::classname(), [
                    'data' => ArrayHelper::map($data, 'wename', 'wename'),
                    'options' => ['placeholder' => '请输入公众号'],
                    'pluginOptions' => [
                        'allowClear' => true
                    ],
                ]);
                ?>  
            </div>
            
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
            </div>
            <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
                <?= $form->field($model, 'msg')->textarea(['rows' => 6]) ?>
            </div>

            

            

            <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12"> 
                <input type="file" name="file" id="file" /> 

            </div>

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>
            </div>

            <div class="form-group col-lg-12 col-xs-12 col-sm-12 col-md-12 text-center">
                <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success col-lg-offset-5 col-xs-offset-5 col-sm-offset-5 col-md-offset-5' : 'btn btn-primary col-lg-offset-5 col-xs-offset-5 col-sm-offset-5 col-md-offset-5']) ?>
                <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
            </div>

            <?php ActiveForm::end(); ?>
        </div>
    </div>

</div>
